@use "./nprogress.scss";
@use "./small.scss";
@use "./dark.scss";

@font-face {
	font-family: Roboto;
	src: url(//cdn.fastdotnet.com/fonts/Roboto/Roboto-Thin.ttf);
	font-weight: 200;
	font-display: swap;
}

@font-face {
	font-family: Roboto;
	src: url(//cdn.fastdotnet.com/fonts/Roboto/Roboto-Light.ttf);
	font-weight: 300;
	font-display: swap;
}

@font-face {
	font-family: Roboto;
	src: url(//cdn.fastdotnet.com/fonts/Roboto/Roboto-Regular.ttf);
	font-weight: 400;
	font-display: swap;
}

@font-face {
	font-family: Roboto;
	src: url(//cdn.fastdotnet.com/fonts/Roboto/Roboto-Medium.ttf);
	font-weight: 500;
	font-display: swap;
}

@font-face {
	font-family: Roboto;
	src: url(//cdn.fastdotnet.com/fonts/Roboto/Roboto-Bold.ttf);
	font-weight: 700;
	font-display: swap;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	outline: none !important;
}

* {
	scrollbar-color: var(--el-scrollbar-bg-color) var(--el-fill-color-light);
}

*::-webkit-scrollbar {
	width: 6px;
}

*::-webkit-scrollbar:horizontal {
	height: 6px;
}

*::-webkit-scrollbar-track {
	border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
	background-color: #0003;
	border-radius: 10px;
	transition: all 0.2s ease-in-out;
}

*::-webkit-scrollbar-thumb:hover {
	cursor: pointer;
	background-color: #0000004d;
}

/* 取消input的上下箭头 */
input::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
}
input::-webkit-outer-spin-button {
	-webkit-appearance: none !important;
}

html,
body,
#app,
#watermark {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	background-color: var(--el-bg-color);
	overflow-y: hidden;
	font-size: var(--el-font-size-base);
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	font-family:
		Roboto,
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		"Helvetica Neue",
		Helvetica,
		Arial,
		sans-serif,
		"Apple Color Emoji",
		"Segoe UI Emoji",
		"Segoe UI Symbol";
}

.w100 {
	width: 100%;
}

.h100 {
	height: 100%;
}

.fa-error-page {
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	.icon {
		width: 400px;
		height: 400px;
		margin-bottom: 50px;
		svg {
			width: 100%;
			height: 100%;
		}
	}
}

/** 左右布局，左边自动宽度 */
.fa__display_lr-l {
	// --width: 400px;
	--width: 30%;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	> :first-child {
		flex: 1;
		min-width: 0px;
		width: auto;
		height: auto;
	}
	> :last-child {
		max-width: var(--width);
		margin-left: 10px;
	}
}

/** 左右布局，右边自动宽度 */
.fa__display_lr-r {
	// --width: 400px;
	--width: 30%;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	> :first-child {
		max-width: var(--width);
		margin-right: 10px;
	}
	> :last-child {
		flex: 1;
		min-width: 0px;
		width: auto;
		height: auto;
	}
}

/** 上下布局，上边自动宽度 */
.fa__display_tb-t {
	--height: 50%;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	> :first-child {
		flex: 1;
		min-height: 0px;
	}
	> :last-child {
		max-height: var(--height);
		margin-top: 10px;
	}
}

/** 上下布局，下边自动宽度 */
.fa__display_tb-b {
	--height: 50%;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	> :first-child {
		max-height: var(--height);
		margin-bottom: 10px;
	}
	> :last-child {
		flex: 1;
		min-height: 0px;
	}
}

/* 修复 Chrome 浏览器输入框内选中字符行高异常的bug */
.el-input .el-input__inner {
	line-height: calc(var(--el-input-height, 40px) - 4px);
}

.el-input-number {
	width: 100%;
	.el-input__inner {
		text-align: left !important;
	}
}

.el-divider__text {
	&.is-center {
		transform: translateX(-50%) translateY(-62%);
	}
}

.el-menu {
	user-select: none;
	.el-sub-menu__title:hover {
		background-color: var(--el-color-primary-light-9) !important;
	}
}

.el-table {
	--el-table-border-color: var(--el-border-color);
}

.el-card {
	box-sizing: border-box;
	padding: 10px;
	overflow-x: hidden;
	.el-card__header {
		border-bottom: 1px solid var(--el-border-color-extra-light);
	}
}

.el-tabs {
	height: inherit;
	&.el-tabs--top {
		.el-tabs__content {
			flex: 1;
			display: flex;
			flex-direction: column;
		}
	}
	.el-tabs__content {
		padding: 10px;
		height: 100%;
		.el-tab-pane {
			flex: 1;
			height: 100%;
			display: flex;
			flex-direction: column;
			> :first-child {
				height: 100%;
			}
		}
	}
}

.el-textarea__inner {
	padding: 5px 11px;
}

.el-form {
	.el-form-item--small {
		margin-bottom: 14px;
	}
	.el-form-item {
		// 分割线
		&:has(.el-form-item__content > .el-divider--horizontal) {
			margin-bottom: 0;
		}
	}
	&:not(.g-form-detail) {
		.el-form-item {
			// 表单组件宽度100%
			.el-form-item__content {
				> * {
					width: 100%;
				}
			}
		}
	}
}

/* 消息提示框换行 */
.el-message {
	white-space: pre-wrap !important;
}
.el-notification {
	white-space: pre-wrap !important;
}

.el-divider--horizontal {
	margin: 8px 0 18px !important;
}
.el-divider--vertical {
	margin: 0 4px !important;
}

.el-select-dropdown {
	.el-select-dropdown__item {
		padding: 0 20px;
	}
}
.el-tree-select__popper {
	.el-select-dropdown__item {
		padding: 0 20px 0 0;
	}
}

.el-dropdown {
	line-height: normal;
}

.el-checkbox.is-bordered.is-disabled.is-checked {
	border-color: var(--el-color-primary);
}

.el-form {
	/* 解决不能包含 el-form-item 的margin的高度 */
	overflow: hidden;
}

/* 外边距、内边距全局样式 */
@for $i from 0 through 100 {
	.mt#{$i} {
		margin-top: #{$i}px !important;
	}
	.mr#{$i} {
		margin-right: #{$i}px !important;
	}
	.mb#{$i} {
		margin-bottom: #{$i}px !important;
	}
	.ml#{$i} {
		margin-left: #{$i}px !important;
	}
	.pt#{$i} {
		padding-top: #{$i}px !important;
	}
	.pr#{$i} {
		padding-right: #{$i}px !important;
	}
	.pb#{$i} {
		padding-bottom: #{$i}px !important;
	}
	.pl#{$i} {
		padding-left: #{$i}px !important;
	}
}
